#ifndef NOISEMAP_H
#define NOISEMAP_H
#include "Dependencies/SimplexNoise/src/SimplexNoise.h"
#include "RGBEffect.h"

class NoiseMap : public RGBEffect
{
public:
    NoiseMap();
    ~NoiseMap();

    void StepEffect(ControllerZone* const controller_zone) override;
private:
    void Defaults();
    void ResetNoise();
    RGBColor GetColor(unsigned int, unsigned int);

    float val_mult = 10000;
    float inv_val_mult = 1.f / val_mult;

    float default_frequency = 0.12;
    float default_amplitude = 3.9;
    float default_lacunarity = 0.75;
    float default_persistence = 0.5;
    int default_octaves = 2;
    int default_motion = 0;
    int default_motion_speed = 0;

    float frequency = default_frequency;
    float amplitude = default_amplitude;
    float lacunarity = default_lacunarity;
    float persistence = default_persistence;
    unsigned int octaves = default_octaves;
    unsigned int motion = default_motion;
    unsigned int motion_speed = default_motion_speed;

    SimplexNoise* noise;

    double progress = 0.f;

    void ResetColors();
    void GenerateGradient();
    //ColorPicker* CreatePicker(int);
    std::vector<RGBColor> colors;
    //std::vector<ColorPicker*> color_pickers;
    QImage image = QImage(100, 1, QImage::Format_RGB32);
};

#endif // NOISEMAP_H
